package com.mercycrazy.recruit.config;

import com.mercycrazy.recruit.filter.LoginUserInfoInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

/**
 * Web MVC 配置
 *
 * @author <a href="mailto:1443424326@qq.com">mercycrazy</a>
 * @since 2023-01-16
 */
@Configuration
public class BossRecruitWebMvcConfig implements WebMvcConfigurer {

    @Resource
    private LoginUserInfoInterceptor loginUserInfoInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {

        // 添加用户身份统一登录拦截的拦截器
        registry.addInterceptor(loginUserInfoInterceptor)
                .addPathPatterns("/**").order(0);
    }
}
